<?php
/**
 * Created by PhpStorm.
 * User: iraklis
 * Date: 12/7/13
 * Time: 1:12 AM
 */
session_start();
if (!isset($_SESSION["level"])) header("location:login.php");
?>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <link rel="shortcut icon" href="./files/img/favicon.ico">
    <title>RemindMe - Add new reminder</title>

    <link type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="Stylesheet" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

    <script type="text/javascript">
    $(function() {
     $("#start_date").datepicker(
         {
             dateFormat:"yy-mm-dd"
         });
    });

    function showRepeatition(id) {
        if (document.getElementById(id).style.display == 'none') {
            document.getElementById(id).style.display = 'block';
        }
        else {
            document.getElementById(id).style.display = 'none';
        }
    }
    </script>
</head>
<style type="text/css">
    @import "style2.css";
</style>

<script type="text/javascript" src="./scripts.js"></script>

<?php
include 'sql.php';
?>

<body>

<div id="access">
    <?php echo showRightPanel(); ?>
</div> <!--End of access-->

<!--
Start Header Area
-->
<div id="header">
    <?php showMenu(); ?>
</div><!-- End of HEADER -->

<!--
 Start Left Panel Area
 -->
<?php showLeftPanel($_SESSION['level'], $_SESSION['user']); ?>
<!--
End of Left_panel
-->

<!--
 Start Container Area
 -->

<div id="container">
    <div id="content"><!-- Content Area-->
        <div id="reminder_form">
        <p>Add a new reminder by filling the form below <br />
            <form id="insert_reminder" action="sql.php" method="post">
                <label>Title:</label>
                <input type="text" id="title" name="title"><br /><br />
                    <div id="dates">
                        <label>Start date:</label>
                        <input type="datetime" id="start_date" name="start_date" value="<?php echo date("Y-m-d");?>"><br /><br />
                        <label>Start time:</label>
                        <select name="start_hours">
                            <option value="1">1 am</option>
                            <option value="2">2 am</option>
                            <option value="3">3 am</option>
                            <option value="4">4 am</option>
                            <option value="5">5 am</option>
                            <option value="6">6 am</option>
                            <option value="7">7 am</option>
                            <option value="8">8 am</option>
                            <option value="9">9 am</option>
                            <option value="10">10 am</option>
                            <option value="11">11 am</option>
                            <option value="12">12 pm</option>
                            <option value="13">1 pm</option>
                            <option value="14">2 pm</option>
                            <option value="15">3 pm</option>
                            <option value="16">4 pm</option>
                            <option value="17">5 pm</option>
                            <option value="18">6 pm</option>
                            <option value="19">7 pm</option>
                            <option value="20">8 pm</option>
                            <option value="21">9 pm</option>
                            <option value="22">10 pm</option>
                            <option value="23">11 pm</option>
                            <option value="00">12 am</option>
                        </select>
                        <select name="start_mins">
                            <option value="0">0 min</option>
                            <option value="5">5 min</option>
                            <option value="10">10 min</option>
                            <option value="15">15 min</option>
                            <option value="20">20 min</option>
                            <option value="25">25 min</option>
                            <option value="30">30 min</option>
                            <option value="35">35 min</option>
                            <option value="40">40 min</option>
                            <option value="45">45 min</option>
                            <option value="50">50 min</option>
                            <option value="55">55 min</option>
                        </select>
                        <br /><br />
                        <label>End time:</label>
                        <select name="end_hours">
                            <option value="1">1 am</option>
                            <option value="2">2 am</option>
                            <option value="3">3 am</option>
                            <option value="4">4 am</option>
                            <option value="5">5 am</option>
                            <option value="6">6 am</option>
                            <option value="7">7 am</option>
                            <option value="8">8 am</option>
                            <option value="9">9 am</option>
                            <option value="10">10 am</option>
                            <option value="11">11 am</option>
                            <option value="12">12 pm</option>
                            <option value="13">1 pm</option>
                            <option value="14">2 pm</option>
                            <option value="15">3 pm</option>
                            <option value="16">4 pm</option>
                            <option value="17">5 pm</option>
                            <option value="18">6 pm</option>
                            <option value="19">7 pm</option>
                            <option value="20">8 pm</option>
                            <option value="21">9 pm</option>
                            <option value="22">10 pm</option>
                            <option value="23">11 pm</option>
                            <option value="00">12 am</option>
                        </select>
                        <select name="end_mins">
                            <option value="0">0 min</option>
                            <option value="5">5 min</option>
                            <option value="10">10 min</option>
                            <option value="15">15 min</option>
                            <option value="20">20 min</option>
                            <option value="25">25 min</option>
                            <option value="30">30 min</option>
                            <option value="35">35 min</option>
                            <option value="40">40 min</option>
                            <option value="45">45 min</option>
                            <option value="50">50 min</option>
                            <option value="55">55 min</option>
                        </select>
                    </div>
                <label for="repeats">Recurrent Event? </label>
                <input type="checkbox" name="repeats" id="repeats" value="1" onclick="showRepeatition('repeatition');"/>
                <div id="repeatition" style="display: none">
                    <label>Daily: </label><input type="radio" name="repeats-freq" id="daily" value="1"><br /><br />
                    <label>Weekly: </label><input type="radio" name="repeats-freq" id="weekly" value="7"><br /><br />
                    <label>Monthly: </label><input type="radio" name="repeats-freq" id="monthly" value="30"><br /><br />
                    <label>Yearly: </label><input type="radio" name="repeats-freq" id="yearly" value="365"><br /><br />
                </div> <!--end of repeatition -->
                <br /><br />
                <label>Location:</label>
                <input type="text" id="location" name="location"><br /><br />
                <label>Description:</label>
                <input type="text" id="description" name="description"><br /><br />
                <!-- <label>Type:</label>
                <input type="text" id="type"><br /><br /> -->
                <input type="submit" value="Add new reminder!" name="submit_new_reminder">
            </form>
        </div>
    </div><!--END of content-->
</div><!--END of container-->

<?php showFooter(); ?><!--END of footer-->
</body>

</html>